﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Windows.Forms;
using Hydrobase;
using HydrobaseSDK;
using TheDarkOwlLogger;
using RSSApplicationUpdater;
using LocaleHundler;
using wow_backtiupCore;
namespace wow_backtiup
{ 
    /// <summary>
    /// External application configuration window
    /// </summary>
    public partial class ConfigEXtAplicationsform : Form
    {
        hydrobaseADO ado = new hydrobaseADO();
        public ConfigEXtAplicationsform()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            try
            {
                this.Close();

            }
            catch (Exception ex)
            {


                Program.Bugtracking(ex);
            }
        }

        private void ConfigEXtAplicationsform_Load(object sender, EventArgs e)
        {
            try
            {
                if ((optionsCore.AppinfoSet != null) || (optionsCore.AppinfoSet.Tables[0] != null))
                {

                    ado.SendtoDataGrid2(this.dtgrExtApplications, optionsCore.AppinfoSet, SDKBase.ApplicationPreferencesDir + "\\" + optionsCore.extappinfofile + BaseClass.default_fileextension,0);


                }


            }
            catch (Exception ex)
            {


                Program.Bugtracking(ex);
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {

            try
            {
                ado.SaveTable(optionsCore.AppinfoSet, SDKBase.ApplicationPreferencesDir + "\\" + optionsCore.extappinfofile + BaseClass.default_fileextension, 0, Application.ProductName + " - " + Application.ProductVersion);
                this.Close();
        

            }
            catch (Exception ex)
            {


                Program.Bugtracking(ex);
            }//settingDir + "\\" + extappinfofile + BaseClass.default_fileextension
        
        }
    }
}
